<template>
  <div>
    <Row class="clearfix" :gutter='32'>
      <Col span="12" class="card">
      <Card>
        <p slot="title">欢迎回来!</p>
        <p class="admin">{{userName}}</p>
        <p class="date">{{currentdate}}</p>
      </Card>
      </Col>
      <Col span="12" class="card">
      <Card>
        <div class="box">
          <p class="p-title">待审核赛事</p>
          <p class="number" style="cursor:pointer;" @click="hrefStatus(1)">{{status1Count}}<span>场</span></p>
        </div>
        <div class="box">
          <p class="p-title">未通过赛事</p>
          <p class="number" style="cursor:pointer;" @click="hrefStatus(3)">{{status3Count}}<span>场</span></p>
        </div>
      </Card>
      </Col>
    </Row>
    <Row style="padding-top:20px"> 
      <apply-table ref='apply' :model="pageModel"></apply-table>
    </Row>
  </div>
</template>

<script>
import dict from "_c/dict/dict.vue";
import dictSpan from "_c/dict/dict-span.vue";
import applyTable from "@/view/game-apply/components/apply-table";
import { fieldAddress } from "@/config/utils";
import { getDict } from "@/api/configure";
import Api from "@/api/game-apply";
const api = new Api();
// 赛事管理
export default {
  components: {
    dict,
    dictSpan,
    applyTable
  },
  data() {
    return {
      loading: true,
      status1Count: 0,
      status3Count: 0,
      userName: this.$store.state.user.userName,
      total: 0,
      currentdate: this.$moment().format("YYYY-MM-DD"),
      page: {
        pageSize: this.$config.PAGE_SIZE,
        pageNo: 1
      },
      pageModel: {}
    };
  },
  created() {
    let self = this;
    api.homeStatistics({ verifyStatusList: [1] }).then(data => {
      self.status1Count = data;
    });
    api.homeStatistics({ verifyStatusList: [3] }).then(data => {
      self.status3Count = data;
    });
  },
  methods: {
    hrefStatus(status) {
      this.$router.push({
        path: `/game-management/apply?verifyStatus=${status}`
      });
    }
  }
};
</script>

<style lang="less" scoped>
.ivu-card-head p {
  font-size: 21px;
  color: #999;
}
.content-wrapper .ivu-card-head {
  border-bottom: none;
}
.box {
  display: inline-block;
  width: 50%;
  text-align: center;
  padding-top: 30px;
}
.admin {
  color: #66cc99;
  font-size: 30px;
  font-weight: bold;
}
.date {
  font-size: 30px;
  color: #9b9b9b;
  text-align: right;
}
.table-title {
  font-size: 20px;
  padding-bottom: 15px;
}
.ivu-card-bordered {
  min-height: 175px;
}
.number {
  font-size: 30px;
  color: #58b382;
}
.p-title {
  font-size: 27px;
  color: #999;
}
</style>
